#include "BigInteger.h"
#include <iostream>

int main() {
    BigInteger a, b;
    char op;

    std::cout << "请输入第一个大数：";
    std::cin >> a;

    std::cout << "请输入运算符（+、-、*、/）：";
    std::cin >> op;

    std::cout << "请输入第二个大数：";
    std::cin >> b;

    BigInteger result;

    switch (op) {
        case '+':
            result = a + b;
            break;
        case '-':
            result = a - b;
            break;
        case '*':
            result = a * b;
            break;
        case '/':
            try {
                result = a / b;
            } catch (const std::invalid_argument& e) {
                std::cout << "错误：" << e.what() << std::endl;
                return 1;
            }
            break;
        default:
            std::cout << "无效的运算符" << std::endl;
            return 1;
    }

    std::cout << "计算结果：" << result << std::endl;

    return 0;
}
